namespace OWA.Activities
{
    using System;
    using System.Xml.Schema;

    public static class SchemaLoader
    {
        static readonly string _rootSchema = "all.xsd";

        public static XmlSchemaSet GetAllSchemas()
        {
            XmlSchemaSet schemas = new XmlSchemaSet();
            AssemblyResolver resolver = new AssemblyResolver();
            schemas.XmlResolver = resolver;
            
            Uri schemaUri = resolver.ResolveUri(
                null, _rootSchema);
            schemas.Add((XmlSchema)resolver.GetEntity(schemaUri, null, null));
            schemas.Compile();
            return schemas;
        }
    }
}
